package com.qf.controller;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description: 公用常量
 * @Data: 2022/9/8 10:25
 * @Pacakge: com.qf.controller
 * @ClassName: HelloController
 * @Author: fan
 */
@RestController
public class HelloController {
    @Autowired
    private DruidDataSource druidDataSource;
    @RequestMapping("sayhello")
    public Map<String,String> sayHello(){
        Map<String, String> map = new HashMap<>();
        map.put("name","小樊");
        map.put("age","18");
        return map;
    }
    @RequestMapping("druid")
    public Map<String,String>druid(){
        Map<String, String> map = new HashMap<>();
        map.put("driverClassName",druidDataSource.getDriverClassName());
        map.put("url",druidDataSource.getUrl());
        map.put("username",druidDataSource.getUsername());
        map.put("password",druidDataSource.getPassword());
        return map;
    }
}
